package com.hb.trade.api.routine.config.pay;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;

/**
 * 支付数据配置
 **/
@Configuration
public class PaymentConfig {

    /**
     * 微信-绑定的APPID(公众号, 小程序, APP等)
     */
    public static String WX_APP_ID;

    /**
     * 微信-商户号（法正智能）
     */
    public static String WX_MCH_ID;

    /**
     * 微信-支付密钥
     */
    public static String WX_PAY_KEY;


    /**
     * 支付宝-绑定的APPID(公众号, 小程序, APP等)
     */
    public static String ALI_APP_ID;

    /**
     * 支付宝-私钥 pkcs8格式的(多多中标)
     */
    public static String ALI_RSA_PRIVATE_KEY;

    /**
     * 支付宝-公钥
     */
    public static String ALI_ALIPAY_PUBLIC_KEY;


    @Value("${wx.appId}")
    public void setWxAppId(String wxAppId) {
        PaymentConfig.WX_APP_ID = wxAppId;
    }

    @Value("${wx.mchId}")
    public void setWxMchId(String wxMchId) {
        PaymentConfig.WX_MCH_ID = wxMchId;
    }

    @Value("${wx.payKey}")
    public void setWxPayKey(String wxPayKey) {
        PaymentConfig.WX_PAY_KEY = wxPayKey;
    }


    @Value("${ali.appId}")
    public void setAliAppId(String aliAppId) {
        PaymentConfig.ALI_APP_ID = aliAppId;
    }

    @Value("${ali.rsaPrivateKey}")
    public void setAliRsaPrivateKey(String aliRsaPrivateKey) {
        PaymentConfig.ALI_RSA_PRIVATE_KEY = aliRsaPrivateKey;
    }

    @Value("${ali.alipayPublicKey}")
    public void setAliAlipayPublicKey(String aliAlipayPublicKey) {
        PaymentConfig.ALI_ALIPAY_PUBLIC_KEY = aliAlipayPublicKey;
    }
}
